import 'package:flutter/material.dart';

class TextView extends StatefulWidget {
  const TextView({super.key});

  @override
  State<TextView> createState() => _TextViewState();
}

class _TextViewState extends State<TextView> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(body: Center(child: baseTextView()),);
  }

  Widget baseTextView() {
    return Text(
      '基本样式',
      style: TextStyle(
        fontSize: 24.0,          // 字体大小
        color: Colors.blue,      // 文字颜色
        fontWeight: FontWeight.bold, // 字体粗细
        fontStyle: FontStyle.italic, // 字体样式(斜体)
        letterSpacing: 2.0,      // 字母间距
        wordSpacing: 5.0,        // 单词间距
        height: 1.5,             // 行高(倍数)
        backgroundColor: Colors.yellow, // 背景色
        decoration: TextDecoration.underline, // 装饰线(下划线)
        decorationColor: Colors.red, // 装饰线颜色
        decorationStyle: TextDecorationStyle.dashed, // 装饰线样式
        shadows: [               // 文字阴影
          Shadow(
            color: Colors.black,
            offset: Offset(2.0, 2.0),
            blurRadius: 3.0,
          ),
        ],
      ),
    );
  }
}
